package com.example.lay.service;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

/**
 * Created by Lay on 2014/12/9.
 */
public class MySwitchActivity extends Activity {
    private final String ACTION = "www.lalio.xyz.FIRST_SERVICE";
    private final Intent intent = new Intent();

    {
        intent.setAction(ACTION);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.acvitity_stop_start);
    }

    public void close(View view) {
        stopService(intent);
    }

    public void open(View view) {
        startService(intent);
    }
}
